package cc.loac.heba.controller;

import cc.loac.heba.service.LoginTokenService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class LoginTokenController {
    @Resource
    LoginTokenService loginTokenService;

    @GetMapping("/loginToken/checkToken")
    @ResponseBody
    public String checkToken(@RequestParam("token") String token,
                             @RequestParam("email") String email) {
        return loginTokenService.checkTokens(email, token);
    }

}
